-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SFR-2239: Remove error codes from error page #536
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
src/components/Feedback/Feedback.tsx
Outdated
@@ -38,7 +44,7 @@ const Feedback: React.FC<any> = ({ location }) => { | |||
values: React.ComponentProps<typeof FeedbackBox>["onSubmit"] | |||
) => { | |||
submitFeedback({ | |||
feedback: values.comment, | |||
feedback: isError ? `${statusCode} - ${values.comment}` : values.comment, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like statusCode could be null though I hope that's never the case so we may just want to have a default. What are your thoughts?
{statusCode ?? 'Unknown'} - ${values.comment}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may also want to prefix the status code with something like Error Code: or HTTP Status Code: just so folks understand what the status code means!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, good idea!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add some before/after screenshots when you get the chance? Super helpful for the reviewer to quickly spot check the design changes. Thanks!
The vercel link https://sfr-bookfinder-front-end-git-sfr-2239-remove-error-codes-nypl.vercel.app/ can't find the home page but the error page looks good.
feedback: isError | ||
? `Error Code: ${statusCode ?? "Unknown"} - ${values.comment}` | ||
: values.comment, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice - looks good!
heading: "Something went wrong on our end.", | ||
subText: "We encountered an error while trying to load the page. ", | ||
tryText: "Try refreshing the page or ", | ||
}, | ||
404: { | ||
overline: "error 404", | ||
heading: "We couldn't find that page.", | ||
subText: | ||
"The page you were looking for doesn't exist or may have moved elsewhere. ", | ||
tryText: "Try a different URL or ", | ||
}, | ||
400: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May want to consider having a default error map.
src/pages/_error.tsx
Outdated
width={100} | ||
/> | ||
<Text size="overline1">{errorMap[statusCode].overline}</Text> | ||
<Heading marginTop="s" marginBottom="s"> | ||
{errorMap[statusCode].heading} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here you may just want guard against unexpected error codes like 502, 503, 403 and go to the default error mapping.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spoke with Apoorva and she recommended that we use the 400 error as default.
Jira Ticket
Figma Designs
This PR does the following:
Testing requirements & instructions:
Before (Desktop):
After (Desktop):
Before (Mobile):
After (Mobile):